﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Xml.Serialization;

namespace nGSO
{
    /// <summary>
    /// Agent history changes
    /// </summary>
    [XmlRoot("history")]
    public class AgentHistory
    {
        [XmlAttribute("luciferin")]
        public double Luciferin { get; set; }

        [XmlIgnore]
        public IList<Agent> Neighbours { get; set; }

        [XmlAttribute("range")]
        public double NeighborhoodRange { get; set; }

        [XmlAttribute("fun_value")]
        public double FunctionValue { get; set; }

        [XmlAttribute("step")]
        public int Step { get; set; }

        [XmlAttribute("moveProbability")]
        public double MovingProbability { get; set; }

        [XmlAttribute("neighbours")]
        public int TotalNeighbours
        {
            get
            {
                return Neighbours.Count;
            }
            set
            {
                /*throw new InvalidOperationException();*/
            }
        }

        [XmlAttribute("gsov1")]
        public bool AppliedGsoV1 { get; set; }

        [XmlAttribute("gsov2")]
        public bool AppliedGosV2 { get; set; }

        [XmlArrayItem]
        public double[] Loc { get; set; }

        public AgentHistory()
        {
            Neighbours = new List<Agent>();
        }
    }
}
